package com.ccloud.gen.engine.config;


import lombok.Data;

/**
 * @Version V1.0
 * @Project bigdata-cloud
 * @Title DaoConfig
 * @Description Dao模板生成的配置
 * @Package com.ccloud.gen.engine.config
 * @Date 2021/7/8 3:34 下午
 * @Copyright: 武汉大数据产业发展有限公司 All rights reserved.
 */
@Data
public class MapperConfig {

    private ContextConfig contextConfig;

    private String daoPathTemplate;
    private String xmlPathTemplate;

    private String packageName;

    public void init() {
        this.daoPathTemplate = "\\src\\main\\java\\" + contextConfig.getProPackage().replaceAll("\\.", "\\\\") + "\\"+contextConfig.getBizPackageName()+"\\modules\\" + contextConfig.getModuleName() + "\\mapper\\{}Mapper.java";
        this.xmlPathTemplate = "\\src\\main\\java\\" + contextConfig.getProPackage().replaceAll("\\.", "\\\\") + "\\"+contextConfig.getBizPackageName()+"\\modules\\" + contextConfig.getModuleName() + "\\mapper\\mapping\\{}Mapper.xml";
        this.packageName = contextConfig.getProPackage() + "."+contextConfig.getBizPackageName()+"." + contextConfig.getModuleName() + ".mapper";
    }

}
